using System;
using System.Web.UI;
using com.paypal.soap.api;

namespace ASPDotNetSamples
{
	/// <summary>
	/// Summary description for TransactionDetails.
	/// </summary>
	public class Errors : UserControl
	{
		protected System.Web.UI.WebControls.Repeater ErrorsRepeater;
	
		private void Page_Load(object sender, EventArgs e)
		{
		
		}

		protected override void OnPreRender(EventArgs e)
		{
			base.OnPreRender (e);
			this.DataBind();
		}
		
		public string getStyle(com.paypal.soap.api.AbstractResponseType response)
		{
			if(response.Ack == AckCodeType.Failure || response.Ack == AckCodeType.SuccessWithWarning)
			{
				return "display:block;";		
			}
			else
			{
				return "display:none;";
			}
		}


		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}

		protected AbstractResponseType PayPalResponse
		{
			get
			{
                return ((BasePage)this.Page).PayPalResponse;
			}
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);

		}
        #endregion
	}
}
